Drop gdk_cursor_new_from_pixbuf
authorMatthias Clasen <mclasen@redhat.com>
Thu, 30 Nov 2017 01:16:43 +0000 (20:16 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 30 Nov 2017 01:16:43 +0000 (20:16 -0500)
Part of the push to remove GdkPixbuf from the API.

docs/reference/gdk/gdk4-sections.txt
gdk/gdkcursor.c
gdk/gdkcursor.h

index b199ea93c7ea51d58e5d7464d7e3c26f4b9808c6..9097af5db15522cea4c5e6d098b833166a39452e 100644 (file)
@@ -811,15 +811,14 @@ GDK_IS_TEXTURE
 <TITLE>Cursors</TITLE>
 <FILE>cursors</FILE>
 GdkCursor
-gdk_cursor_new_from_pixbuf
-gdk_cursor_new_from_surface
+gdk_cursor_new_from_texture
 gdk_cursor_new_from_name
 gdk_cursor_get_display
 gdk_cursor_get_fallback
 gdk_cursor_get_name
+gdk_cursor_get_texture
 gdk_cursor_get_hotspot_x
 gdk_cursor_get_hotspot_y
-gdk_cursor_get_texture
 
 <SUBSECTION Standard>
 GDK_TYPE_CURSOR
index 75c8661f70f7c20974d4be9b1a20c07a67bb5ecb..d5e03d7c65d3c25f65ea2faa5bfdcd963cabbb12 100644 (file)
@@ -336,83 +336,6 @@ gdk_cursor_new_from_name (const gchar *name,
                        NULL);
 }
 
-/**
- * gdk_cursor_new_from_pixbuf:
- * @pixbuf: the #GdkPixbuf containing the cursor image
- * @x: the horizontal offset of the “hotspot” of the cursor.
- * @y: the vertical offset of the “hotspot” of the cursor.
- * @fallback: (allow-none): %NULL or the #GdkCursor to fall back to when
- *     this one cannot be supported
- *
- * Creates a new cursor from a pixbuf.
- *
- * Not all GDK backends support RGBA cursors. If they are not
- * supported, a monochrome approximation will be displayed.
- * The functions gdk_display_supports_cursor_alpha() and
- * gdk_display_supports_cursor_color() can be used to determine
- * whether RGBA cursors are supported;
- * gdk_display_get_default_cursor_size() and
- * gdk_display_get_maximal_cursor_size() give information about
- * cursor sizes.
- *
- * If @x or @y are `-1`, the pixbuf must have
- * options named “x_hot” and “y_hot”, resp., containing
- * integer values between `0` and the width resp. height of
- * the pixbuf. (Since: 3.0)
- *
- * On the X backend, support for RGBA cursors requires a
- * sufficently new version of the X Render extension.
- *
- * Returns: a new #GdkCursor.
- *
- * Since: 2.4
- */
-GdkCursor *
-gdk_cursor_new_from_pixbuf (GdkPixbuf  *pixbuf,
-                            gint        x,
-                            gint        y,
-                            GdkCursor  *fallback)
-{
-  GdkTexture *texture;
-  const char *option;
-  char *end;
-  gint64 value;
-  GdkCursor *cursor;
-  g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
-  g_return_val_if_fail (fallback == NULL || GDK_IS_CURSOR (fallback), NULL);
-
-  if (x == -1 && (option = gdk_pixbuf_get_option (pixbuf, "x_hot")))
-    {
-      errno = 0;
-      end = NULL;
-      value = g_ascii_strtoll (option, &end, 10);
-      if (errno == 0 &&
-          end != option &&
-          value >= 0 && value < G_MAXINT)
-        x = (gint) value;
-    }
-  
-  if (y == -1 && (option = gdk_pixbuf_get_option (pixbuf, "y_hot")))
-    {
-      errno = 0;
-      end = NULL;
-      value = g_ascii_strtoll (option, &end, 10);
-      if (errno == 0 &&
-          end != option &&
-          value >= 0 && value < G_MAXINT)
-        y = (gint) value;
-    }
-
-  texture = gdk_texture_new_for_pixbuf (pixbuf);
-  
-  cursor = gdk_cursor_new_from_texture (texture, x, y, fallback);
-
-  g_object_unref (texture);
-
-  return cursor;
-}
-
 /**
  * gdk_cursor_new_from_texture:
  * @texture: the texture providing the pixel data
index 21210a0c3c8d9640ab51da68ffaa9294a33aff29..6f8c7590b1fad5ba21781ad41dffeb6226372e0c 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <gdk/gdkversionmacros.h>
 #include <gdk/gdktypes.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
 
 G_BEGIN_DECLS
 
@@ -45,11 +44,6 @@ G_BEGIN_DECLS
 GDK_AVAILABLE_IN_ALL
 GType      gdk_cursor_get_type           (void) G_GNUC_CONST;
 
-GDK_AVAILABLE_IN_ALL
-GdkCursor* gdk_cursor_new_from_pixbuf   (GdkPixbuf       *pixbuf,
-                                         gint             x,
-                                         gint             y,
-                                          GdkCursor       *fallback);
 GDK_AVAILABLE_IN_3_94
 GdkCursor* gdk_cursor_new_from_texture   (GdkTexture      *texture,
                                          int              hotspot_x,
@@ -58,7 +52,7 @@ GdkCursor* gdk_cursor_new_from_texture   (GdkTexture      *texture,
 GDK_AVAILABLE_IN_ALL
 GdkCursor*  gdk_cursor_new_from_name    (const gchar     *name,
                                           GdkCursor       *fallback);
-                                         
+
 GDK_AVAILABLE_IN_3_94
 GdkCursor * gdk_cursor_get_fallback      (GdkCursor      *cursor);
 GDK_AVAILABLE_IN_3_94